1. Field of the Invention
The present invention relates to a gamut judging apparatus, color transform apparatus and gamut boundary learning method.
2. Description of the Related Art
Devices that handle color images, for example, to input, process, print or display, such as a scanner, personal computer, color printer, color copy machine and monitor, have a limitation in a range of colors to handle. The range of colors that a device can handle is called gamut. Further, the color space of an input image expected in each device is usually different for each device.
Accordingly, handling the color image inside the devices and between the devices needs the color transform for transforming colors of the color image into colors in the gamut that the device can handle, and the color transform processing for transforming colors of the color image into respective amounts in the color space expected in the device. These transforms are called wide-sense color transform.
For example, when a color image input from a scanner is printed in a color copy machine, the gamut of the scanner is different from the gamut actually printed. Therefore, the color transform is needed.
Further, recently generalized operations are that a personal computer is connected to a scanner, monitor and color printer, and a color image input from the scanner is corrected in the monitor, and then is printed in the color printer. Such operations require the color transform between the devices connected thereto.
An example of the color transform from a monitor to a printer is explained. RGB that is an inherent color space of the monitor is once transformed into values in CIE L*a*b* space (hereinafter abbreviated to as Lab space) which does not depend on devices and is generally used. The values are further transformed into colors, reproducible by a printer, in the Lab space. Then, the result is transformed into CMYK that is an input signal for the printer.
At this time, the transform from RGB to the Lab space and the transform from the Lab space to CMYK are achieved by actually displaying or printing images with various RGB values and CMYK values, and based on the result obtained by the color measurement, determining a lookup table and coefficients for linear transform.
However, in the color transform for transforming colors of a monitor into those of a printer in the Lab space, since the gamut of the monitor and the gamut of the printer are largely different from each other, it is fundamentally impossible to reproduce correct colors, and is possible only to reproduce colors approximately.
Various algorithms have been proposed conventionally as the color transform method. An example is disclosed in Japanese Unexamined Patent Publication 60-105376.
The publication describes a color image output apparatus which transforms a color of a source device into a color corresponding to an intersection at which a segment connecting a color on the achromatic axis and a color of the source device intersects a gamut boundary of a target device, and thus performs the color transform when the color of the source device, in other words, a device as a source for the color transform is out of the gamut of the target device, in other words, a device as a target for the color transform.
Generally, to perform the color transform, it is necessary to judge whether a color is in or out of gamut(hereinafter abbreviated to as gamut judging). With respect to the forgoing, however, the publication discloses a method for holding colors in the gamut of each of all devices as a table. However, in the recent devices using RGB values generally each with 8 bits, since the data amount to be held is huge, such a method is not practical.
Further, performed in a document of Jan Morovic and M.Ronnier Luo, xe2x80x9cGamut Mapping Algorithms Based on Psychophysical Experimentxe2x80x9d, The Fifth Color Imaging Conference: Color Science, Systems, and Applications, 1998 is a comparison between various color transform methods including a method similar to that in JP60-105376. As the judgment whether a color is in or out of gamut, the document proposes a gamut judging method described in the following.
The Lab space is transformed into polar coordinate indication as follows:                     r        =                                                            (                                  L                  -                  50                                )                            2                        +                          a              2                        +                          b              2                                                          [                  Eq          .                      xe2x80x83                    ⁢          1                ]                                α        =                              tan                          -              1                                ⁡                      (                          b              a                        )                                              [                  Eq          .                      xe2x80x83                    ⁢          2                ]                                θ        =                              tan                          -              1                                ⁡                      (                                          L                -                50                                                                                  a                    2                                    +                                      b                    2                                                                        )                                              [                  Eq          .                      xe2x80x83                    ⁢          3                ]            
Then, the color space is divided into 16.times.16 areas with xcex1 and xcex8. Next, a color on the gamut boundary in an input space of a target device is obtained, and the obtained color is transformed into the above-mentioned polar coordinate. Then, a color with maximum r is obtained for each of 16.times.16 areas.
To obtain the gamut boundary of a color, a straight line 1 connecting a given color to a center color (point at L=50 on the lightness axis) is calculated. Next, three colors with maximum r such that a triangle obtained by connecting the three colors with maximum r intersects the straight line 1 are selected. Then, the intersection at which the triangle comprised of the three colors intersects the straight line 1 is considered as the gamut boundary of the given color.
However, the gamut boundary of a device has a complicated shape, and further signals input to the device are usually quantized. Therefore, conventionally there has been no simple and accurate method for representing the gamut boundary.
Accordingly, there has been the problem conventionally that not only the color transform, but also the judgment of in-or-out-of-gamut requires large processing and time, or the judgment should be performed with a method with low accuracy.
Thereby, there has been further the problem that the color transform also requires large processing and time, and only achieved is the color transform with original gradation degraded.
An object of the present invention is to provide an apparatus that simply and accurately judges whether a given color is in or out of gamut of a device, i.e., gamut judgment, and the learning method therefor.
Further, using the gamut judgment that can be performed simply and accurately, another object of the present invention is to provide a color transform apparatus capable of transforming colors simply and excellently, and the learning method therefor.
The color transform apparatus of the present invention sets a center color in the gamut of a device, calculates a distance between the center color and a source color, further calculates a distance between the center color and an intersection at which a segment connecting the source color and the center color intersects a gamut boundary of the device, and judges that the source color is out of the gamut of the device when the former distance is larger than the latter distance, while judging that the source color is in the gamut of the device when the former distance is smaller than the latter distance.
Thus, judging whether the source color is in or out of the gamut of the device using the distance between the center color and source color enables the gamut judging apparatus that performs accurate judgment simply to be obtained.
Further, the gamut boundary learning method of the present invention selects a gamut boundary vector connecting the center color set inside the gamut of the device and a color considered to exist on the gamut boundary of the device, and learns the length of the gamut boundary vector using a direction cosine of the gamut boundary vector.
Thus, when a source color is given, the direction cosine for an arbitrary source color capable of being calculated is calculated, and using the direction cosine corresponding to the source color, it is possible to calculate a distance between the gamut boundary and the center color. Accordingly, it is possible to obtain the apparatus and learning method for simply and accurately judging whether the source color is in or out of the gamut.
Further, the color transform apparatus of the present invention calculates a distance between the center color and the gamut boundary of the source device in the source color vector direction, another distance between the center color and the gamut boundary of the target device in the source color vector direction, and obtains a target color corresponding to the source color vector from the calculated two distances.
Thus, it is possible to obtain the simplified excellent color transform apparatus with original gradation kept by obtaining a target color from the distance between the center color and the gamut boundary of the source device in the source color vector direction and the distance between the center color and the gamut boundary of the target device in the source color vector direction.